package com.monitor.controller;

import com.alibaba.fastjson2.JSONObject;
import com.monitor.commons.HttpTookit;
import com.monitor.commons.SkJsonResult;
import com.monitor.commons.YXDate;
import com.monitor.config.yunke.YunKeConfig;
import com.monitor.config.yunke.YunKeUtil;
import com.monitor.dto.WechatDTO;
import com.monitor.dto.WechatPageDTO;
import com.monitor.modelExt.WechatExt;
import com.monitor.pubInter.IBaseService;
import com.monitor.pubInter.exception.SkException;
import com.monitor.searchExt.WechatSearchExt;
import com.monitor.service.IWechatService;
import com.monitor.vo.WechatDetailDomainVO;
import com.monitor.vo.WechatDetailVO;
import com.monitor.vo.WechatDomainVO;
import com.monitor.vo.WechatListVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@RequestMapping("/wechat/")
@RestController(value = "wechatController")
@Slf4j
public class WechatController extends ApiManageController<WechatDTO, WechatPageDTO, WechatExt, WechatSearchExt, WechatDomainVO, WechatDetailDomainVO, WechatDetailVO, WechatListVO, String> {
    @Autowired
    private IWechatService wechatService;

    @Override
    public IBaseService<WechatExt, WechatSearchExt, String> getBaseService() throws SkException {
        return wechatService;
    }
    @Autowired
    private YunKeUtil yunKeUtil;
    @Autowired
    private YunKeConfig yunKeConfig;


    /**
     * 获取微信好友
     * @return
     * @throws Exception
     */
    @PostMapping("queryAllFriendsData")
    public SkJsonResult queryAllFriendsData() throws Exception {
        wechatService.syncWechatData();
        return SkJsonResult.ok();
    }
}
